﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq.Mapping;
using System.Reflection;
using System.IO;

namespace StackBookL2S
{
    public static class ObjectMapping
    {
        public static XmlMappingSource GetMapping(string name)
        {
            XmlMappingSource mapping;
            using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(name))
            {
                mapping = XmlMappingSource.FromStream(stream);
            }

            return mapping;
        }
    }
}
